#ifndef MUSIC_H
#define MUSIC_H

#include <QWidget>

#include <QObject>

#include <QNetworkAccessManager>

#include <QNetworkReply>

#include <QNetworkRequest>

#include <QJsonValue>

#include <QJsonArray>

#include <QJsonDocument>

#include <QJsonObject>
#include <QUrl>
#include <QJsonParseError>
#include <QVariantMap>
#include <QJsonDocument>
#include <QDebug>
#include <QMediaPlayer>
#include <QAudioOutput>
#include <QBuffer>
#include <QMediaPlaylist>
#include <QVideoWidget>
class Music : public QObject
{
    Q_OBJECT

public:
   explicit Music(QObject *parent = 0);
    ~Music();
    void parseJson_getAlbumID(QString json);
    void parseJson_getplay_url(QString json);
    void get_url();
    
    int play_music(QString str);

    void pause_music();

    void stop_music();

    void append_music();

    void voice_up();
    void voice_down();

    void test();
public slots:
    void play_end();
signals:
    void play_finished();
private:
  
    QNetworkAccessManager*music_manger;
    QNetworkRequest music_request;
    QString hash;
    QString songsid;
    QString music_url;
    QString music_urlvalue;
    QNetworkRequest* music_request2 ;
     QNetworkAccessManager*music_manager2;
    QMediaPlayer *qtaudioPlayer;
    QAudioOutput* player;
    QBuffer* buf;
};
#endif 
